package com.taotao.feign.proxy;////package com.mayikt.order.proxy;

import org.springframework.stereotype.Component;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author 余胜军
 * @ClassName FeignClientProxy
 * @qq 644064779
 * @addres www.mayikt.com
 * 微信:yushengjun644
 */

public class FeignClientProxy {

    /**
     * @param tClass com.mayikt.order.api.feign.MemberServiceFeign
     * @param <T>    生成JDK动态代理 生成代理类
     * @return
     */
    public static <T> T create(Class<T> tClass) {
        return (T) Proxy.newProxyInstance(tClass.getClassLoader(), new Class<?>[]{tClass}, new SwFeignInvocationHandler());


    }
}
